$(document).ready(function() {
	document.title = $("#TestName").html();
	
	
	$("#TestButton").click(function (){
		console.log($('#TestForm :input').serializeArray());
	
	});
	
	$("#SubmitButton").click(function() {
		
		if($("#PledgeNameBox").val() == "")
		{
			$( "#ConfirmDialog" ).dialog({
			width: 500,
			  modal: true,
				buttons: {
						"Complete Test": function() {
						  SubmitTest();
						},
						Cancel: function() {
						  $( this ).dialog( "close" );
						}
					  }
			});
		
		}
		else
		{
			SubmitTest();
		}
		return false;
	});
});

function SubmitTest()
{
	document.getElementById('TestForm').action = "SubmitTest.php";
	document.getElementById('TestForm').submit();
}